﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace IceDog.DNL.CSharp.DesignPattern.BuilderPattern.KFC
{
    public class Meal : List<FoodItem>
    {
        public void AddFood(FoodItem item)
        {
            Add(item);
        } 

        public decimal GetCost()
        {
            return this.Sum(f => f.Price);
        }

        public string ShowDetails()
        {
            return this.Aggregate(String.Empty, (result, item) => result + $"name:{item.Name},packing:{item.Packing.Type.ToString()},price:{item.Price}|");
        }
    }
}
